package com.aischool.webapp.family;

import com.aischool.routes.RouteMapping;
import com.aischool.service.SysUserService;
import com.aischool.utils.JsonResult;
import com.jfinal.aop.Inject;
import com.jfinal.core.Controller;

@RouteMapping(url = "/front/family/auth")
public class AuthController extends Controller {

	@Inject
	SysUserService sysUserService;
	
	/**
	 * 登录
	 * url = /api/auth/login/1
	 * token_value = userid, appid, orgid
	 */ 
	public void login() {
		JsonResult jr = sysUserService.login(this);
		renderJson(jr.Dic);
	}
	
	/**
	 * 退出登录
	 */
	public void logout() {
		JsonResult jr = sysUserService.logout(this);
		renderJson(jr.Dic);
	}
	
	public void updateInfo() {
		JsonResult jr = sysUserService.updateInfo(this);
		renderJson(jr.Dic);
	}
	
	public void updatePwd() {
		JsonResult jr = sysUserService.updatePwd(this);
		renderJson(jr.Dic);
	}
}
